Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances state management for devices and links by introducing health and desired status tracking capabilities to the Go SDK.
Changes:
- Added
DeviceHealthandDeviceDesiredStatusenums with JSON serialization support - Added
LinkHealthandLinkDesiredStatusenums with JSON serialization support - Extended
DeviceandLinkstructs with new health and desired status fields
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fix String() Refactor DeviceDesiredStatus String method for clarity and error handling Fix LinkHealth String method to use underscores in status string fix: update expected output to include link_desired_status in test cases
79c7ddd to
48e453d
Compare
elitegreg
approved these changes
Jan 15, 2026
ANISH-SR
pushed a commit
to ANISH-SR/doublezero
that referenced
this pull request
Jan 20, 2026
This pull request introduces new health and desired status fields for both devices and links in the `serviceability/state.go` file, enhancing the ability to track and serialize their operational states. These changes add new enums, fields, and JSON serialization logic to support more granular state management. **Device state enhancements:** - Added new enums: `DeviceHealth` and `DeviceDesiredStatus`, with corresponding string values and JSON serialization methods. - Updated the `Device` struct to include `DeviceHealth` and `DeviceDesiredStatus` fields. - Modified the `Device` JSON serialization to output the new health and desired status fields. [[1]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R399-R400) [[2]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R420-R421) - Added a new `DeviceStatusDrained` status to the existing `DeviceStatus` enum. **Link state enhancements:** - Added new enums: `LinkHealth` and `LinkDesiredStatus`, with corresponding string values and JSON serialization methods. - Updated the `Link` struct to include `LinkHealth` and `LinkDesiredStatus` fields. - Modified the `Link` JSON serialization to output the new health and desired status fields. [[1]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R557-R558) [[2]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R569-R570) --------- Co-authored-by: jolveira@gmail.com <jolveira@gmail.com>
ANISH-SR
pushed a commit
to ANISH-SR/doublezero
that referenced
this pull request
Jan 26, 2026
This pull request introduces new health and desired status fields for both devices and links in the `serviceability/state.go` file, enhancing the ability to track and serialize their operational states. These changes add new enums, fields, and JSON serialization logic to support more granular state management. **Device state enhancements:** - Added new enums: `DeviceHealth` and `DeviceDesiredStatus`, with corresponding string values and JSON serialization methods. - Updated the `Device` struct to include `DeviceHealth` and `DeviceDesiredStatus` fields. - Modified the `Device` JSON serialization to output the new health and desired status fields. [[1]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R399-R400) [[2]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R420-R421) - Added a new `DeviceStatusDrained` status to the existing `DeviceStatus` enum. **Link state enhancements:** - Added new enums: `LinkHealth` and `LinkDesiredStatus`, with corresponding string values and JSON serialization methods. - Updated the `Link` struct to include `LinkHealth` and `LinkDesiredStatus` fields. - Modified the `Link` JSON serialization to output the new health and desired status fields. [[1]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R557-R558) [[2]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R569-R570) --------- Co-authored-by: jolveira@gmail.com <jolveira@gmail.com>
thijsvanemmerik
pushed a commit
that referenced
this pull request
Feb 3, 2026
This pull request introduces new health and desired status fields for both devices and links in the `serviceability/state.go` file, enhancing the ability to track and serialize their operational states. These changes add new enums, fields, and JSON serialization logic to support more granular state management. **Device state enhancements:** - Added new enums: `DeviceHealth` and `DeviceDesiredStatus`, with corresponding string values and JSON serialization methods. - Updated the `Device` struct to include `DeviceHealth` and `DeviceDesiredStatus` fields. - Modified the `Device` JSON serialization to output the new health and desired status fields. [[1]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R399-R400) [[2]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R420-R421) - Added a new `DeviceStatusDrained` status to the existing `DeviceStatus` enum. **Link state enhancements:** - Added new enums: `LinkHealth` and `LinkDesiredStatus`, with corresponding string values and JSON serialization methods. - Updated the `Link` struct to include `LinkHealth` and `LinkDesiredStatus` fields. - Modified the `Link` JSON serialization to output the new health and desired status fields. [[1]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R557-R558) [[2]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R569-R570) --------- Co-authored-by: jolveira@gmail.com <jolveira@gmail.com>
thijsvanemmerik
pushed a commit
that referenced
this pull request
Feb 3, 2026
This pull request introduces new health and desired status fields for both devices and links in the `serviceability/state.go` file, enhancing the ability to track and serialize their operational states. These changes add new enums, fields, and JSON serialization logic to support more granular state management. **Device state enhancements:** - Added new enums: `DeviceHealth` and `DeviceDesiredStatus`, with corresponding string values and JSON serialization methods. - Updated the `Device` struct to include `DeviceHealth` and `DeviceDesiredStatus` fields. - Modified the `Device` JSON serialization to output the new health and desired status fields. [[1]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R399-R400) [[2]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R420-R421) - Added a new `DeviceStatusDrained` status to the existing `DeviceStatus` enum. **Link state enhancements:** - Added new enums: `LinkHealth` and `LinkDesiredStatus`, with corresponding string values and JSON serialization methods. - Updated the `Link` struct to include `LinkHealth` and `LinkDesiredStatus` fields. - Modified the `Link` JSON serialization to output the new health and desired status fields. [[1]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R557-R558) [[2]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R569-R570) --------- Co-authored-by: jolveira@gmail.com <jolveira@gmail.com>
thijsvanemmerik
pushed a commit
that referenced
this pull request
Feb 3, 2026
This pull request introduces new health and desired status fields for both devices and links in the `serviceability/state.go` file, enhancing the ability to track and serialize their operational states. These changes add new enums, fields, and JSON serialization logic to support more granular state management. **Device state enhancements:** - Added new enums: `DeviceHealth` and `DeviceDesiredStatus`, with corresponding string values and JSON serialization methods. - Updated the `Device` struct to include `DeviceHealth` and `DeviceDesiredStatus` fields. - Modified the `Device` JSON serialization to output the new health and desired status fields. [[1]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R399-R400) [[2]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R420-R421) - Added a new `DeviceStatusDrained` status to the existing `DeviceStatus` enum. **Link state enhancements:** - Added new enums: `LinkHealth` and `LinkDesiredStatus`, with corresponding string values and JSON serialization methods. - Updated the `Link` struct to include `LinkHealth` and `LinkDesiredStatus` fields. - Modified the `Link` JSON serialization to output the new health and desired status fields. [[1]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R557-R558) [[2]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R569-R570) --------- Co-authored-by: jolveira@gmail.com <jolveira@gmail.com>
thijsvanemmerik
pushed a commit
that referenced
this pull request
Feb 3, 2026
This pull request introduces new health and desired status fields for both devices and links in the `serviceability/state.go` file, enhancing the ability to track and serialize their operational states. These changes add new enums, fields, and JSON serialization logic to support more granular state management. **Device state enhancements:** - Added new enums: `DeviceHealth` and `DeviceDesiredStatus`, with corresponding string values and JSON serialization methods. - Updated the `Device` struct to include `DeviceHealth` and `DeviceDesiredStatus` fields. - Modified the `Device` JSON serialization to output the new health and desired status fields. [[1]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R399-R400) [[2]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R420-R421) - Added a new `DeviceStatusDrained` status to the existing `DeviceStatus` enum. **Link state enhancements:** - Added new enums: `LinkHealth` and `LinkDesiredStatus`, with corresponding string values and JSON serialization methods. - Updated the `Link` struct to include `LinkHealth` and `LinkDesiredStatus` fields. - Modified the `Link` JSON serialization to output the new health and desired status fields. [[1]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R557-R558) [[2]](diffhunk://#diff-057f627e5f2629b35f1976fba6eaa1b3c507c511b0f47d2f80a3a1d0c684c4a1R569-R570) --------- Co-authored-by: jolveira@gmail.com <jolveira@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces new health and desired status fields for both devices and links in the
serviceability/state.gofile, enhancing the ability to track and serialize their operational states. These changes add new enums, fields, and JSON serialization logic to support more granular state management.Device state enhancements:
DeviceHealthandDeviceDesiredStatus, with corresponding string values and JSON serialization methods.Devicestruct to includeDeviceHealthandDeviceDesiredStatusfields.DeviceJSON serialization to output the new health and desired status fields. [1] [2]DeviceStatusDrainedstatus to the existingDeviceStatusenum.Link state enhancements:
LinkHealthandLinkDesiredStatus, with corresponding string values and JSON serialization methods.Linkstruct to includeLinkHealthandLinkDesiredStatusfields.LinkJSON serialization to output the new health and desired status fields. [1] [2]